/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * InitialFrame.java
 *
 * Created on 23/11/2009, 23:57:02
 */

package quantizacaovetorial;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 *
 * @author Guto
 */
public class InitialFrame extends javax.swing.JFrame {

    /** Creates new form InitialFrame */
    public InitialFrame() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        atalho1 = new javax.swing.JLabel();
        atalho2 = new javax.swing.JLabel();
        atalho3 = new javax.swing.JLabel();
        atalho4 = new javax.swing.JLabel();
        painelTitle = new javax.swing.JPanel();
        title3 = new javax.swing.JLabel();
        title2 = new javax.swing.JLabel();
        title1 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        infoSubMenuFile = new javax.swing.JMenuItem();
        exitSubMenuFile = new javax.swing.JMenuItem();
        navigateMenu = new javax.swing.JMenu();
        generateDicSubMenuNavigate = new javax.swing.JMenuItem();
        codecSubMenuNavigate = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED, null, new java.awt.Color(153, 153, 153), null, null), "Atalhos do Sistema ", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(102, 102, 102))); // NOI18N

        atalho1.setForeground(new java.awt.Color(102, 102, 102));
        atalho1.setText("Gerar Dicionário:   Alt + D");

        atalho2.setForeground(new java.awt.Color(102, 102, 102));
        atalho2.setText("Codificação:   Alt + C");

        atalho3.setForeground(new java.awt.Color(102, 102, 102));
        atalho3.setText("Informações Sistema:   F1");

        atalho4.setForeground(new java.awt.Color(102, 102, 102));
        atalho4.setText("Sair do Sistema:   Alt + S");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(atalho1)
                .addGap(68, 68, 68)
                .addComponent(atalho2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 84, Short.MAX_VALUE)
                .addComponent(atalho3)
                .addGap(61, 61, 61)
                .addComponent(atalho4)
                .addGap(25, 25, 25))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(atalho1)
                    .addComponent(atalho4)
                    .addComponent(atalho3)
                    .addComponent(atalho2))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        title3.setFont(new java.awt.Font("Segoe Print", 1, 24));
        title3.setForeground(new java.awt.Color(102, 102, 102));
        title3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        title3.setText("Vector Quantization");

        title2.setFont(new java.awt.Font("Segoe Print", 2, 18));
        title2.setForeground(new java.awt.Color(102, 102, 102));
        title2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        title2.setText("Using");

        title1.setFont(new java.awt.Font("Segoe Print", 1, 24));
        title1.setForeground(new java.awt.Color(102, 102, 102));
        title1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        title1.setText("System for Processing Images");

        javax.swing.GroupLayout painelTitleLayout = new javax.swing.GroupLayout(painelTitle);
        painelTitle.setLayout(painelTitleLayout);
        painelTitleLayout.setHorizontalGroup(
            painelTitleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelTitleLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelTitleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(title2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 711, Short.MAX_VALUE)
                    .addComponent(title3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 711, Short.MAX_VALUE)
                    .addComponent(title1, javax.swing.GroupLayout.DEFAULT_SIZE, 711, Short.MAX_VALUE))
                .addContainerGap())
        );
        painelTitleLayout.setVerticalGroup(
            painelTitleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelTitleLayout.createSequentialGroup()
                .addGap(45, 45, 45)
                .addComponent(title1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(title2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(title3)
                .addContainerGap(73, Short.MAX_VALUE))
        );

        fileMenu.setText("Arquivo");

        infoSubMenuFile.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
        infoSubMenuFile.setText("Sobre...");
        infoSubMenuFile.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                infoSubMenuFileActionPerformed(evt);
            }
        });
        fileMenu.add(infoSubMenuFile);

        exitSubMenuFile.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        exitSubMenuFile.setText("Sair");
        exitSubMenuFile.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitSubMenuFileActionPerformed(evt);
            }
        });
        fileMenu.add(exitSubMenuFile);

        jMenuBar1.add(fileMenu);

        navigateMenu.setText("Navegar");

        generateDicSubMenuNavigate.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.ALT_MASK));
        generateDicSubMenuNavigate.setText("Gerar Dicionário");
        generateDicSubMenuNavigate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                generateDicSubMenuNavigateActionPerformed(evt);
            }
        });
        navigateMenu.add(generateDicSubMenuNavigate);

        codecSubMenuNavigate.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK));
        codecSubMenuNavigate.setText("Codificação");
        codecSubMenuNavigate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                codecSubMenuNavigateActionPerformed(evt);
            }
        });
        navigateMenu.add(codecSubMenuNavigate);

        jMenuBar1.add(navigateMenu);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(painelTitle, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(painelTitle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void exitSubMenuFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitSubMenuFileActionPerformed

        int resposta = JOptionPane.showConfirmDialog(this,
                        "Deseja realmente sair da aplicação?",
                        "Sair ",
                        JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);


                if(resposta == JOptionPane.YES_OPTION)
                {
                  System.exit(0);
                }
        
    }//GEN-LAST:event_exitSubMenuFileActionPerformed

    private void generateDicSubMenuNavigateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateDicSubMenuNavigateActionPerformed
        InputLBGFrameDialog frameLGBInput = new InputLBGFrameDialog(new InitialFrame(), true);
        frameLGBInput.openInputLBGFrame();
    }//GEN-LAST:event_generateDicSubMenuNavigateActionPerformed

    private void codecSubMenuNavigateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_codecSubMenuNavigateActionPerformed
        InputQVFrame frameQVInput = new InputQVFrame();
        frameQVInput.openInputQVFrame();
    }//GEN-LAST:event_codecSubMenuNavigateActionPerformed

    private void infoSubMenuFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_infoSubMenuFileActionPerformed
        InformationFrame infoFrame = new InformationFrame(this, true);
        infoFrame.openInformationFrame();
    }//GEN-LAST:event_infoSubMenuFileActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        InitialFrame initial = new InitialFrame();
        initial.setVisible(true);
        initial.setLocationRelativeTo(null);
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel atalho1;
    private javax.swing.JLabel atalho2;
    private javax.swing.JLabel atalho3;
    private javax.swing.JLabel atalho4;
    private javax.swing.JMenuItem codecSubMenuNavigate;
    private javax.swing.JMenuItem exitSubMenuFile;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JMenuItem generateDicSubMenuNavigate;
    private javax.swing.JMenuItem infoSubMenuFile;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JMenu navigateMenu;
    private javax.swing.JPanel painelTitle;
    private javax.swing.JLabel title1;
    private javax.swing.JLabel title2;
    private javax.swing.JLabel title3;
    // End of variables declaration//GEN-END:variables

}
